package com.ming.demo.service.impl;

import com.ming.demo.bean.Result;
import com.ming.demo.mapper.FileMapper;
import com.ming.demo.service.FileService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class FileServiceImpl implements FileService {
    @Autowired
    private FileMapper fileMapper;


    @Override
    public Result<String> uploadFile(String name, String fileName, String infoPeople_id) {
        int res = fileMapper.insertFile(name, fileName, infoPeople_id);
        if(res == 1){
            Result result = new Result();
            result.setCode("200");
            result.setData("success");
            return result;
        }else{
            Result result = new Result();
            result.setCode("500");
            result.setData("error");
            return result;
        }
    }
}
